// 操作token的工具文件

// 1.保存token
export function setToken (token) {
  window.localStorage.setItem('token', token)
}
// 1.1保存刷新的token
export function setrefreshToken (refreshtoken) {
  window.localStorage.setItem('refreshtoken', refreshtoken)
}

// 2.获取token
export function getToken () {
  return window.localStorage.getItem('token')
}
// 2.2获取新的token
export function getrefreshToken () {
  return window.localStorage.getItem('refreshtoken')
}

// 3.删除token
export function removeToken () {
  window.localStorage.removeItem('token')
}
// 3.3删除新的token
export function removerefreshToken () {
  window.localStorage.removeItem('refreshtoken')
}

export function setLocal (key, value) {
  window.localStorage.setItem(key, value)
}

export function getLocal (key) {
  // 返回 让外部获取到
  return window.localStorage.getItem(key)
}

export function removeLocal (key) {
  window.localStorage.removeItem(key)
}
